import { App } from 'vue';
import { getAssetsImage, copyText, formatMDHms, formatCurrency, formatYMDHms, formatMDY, formatAssetsNumber, formatCurrencyAmount, closeTidio, openTidio } from '../index';

/**
 * 添加全局属性，可以直接在template中使用
 * @param app
 */
export const initGlobalProperties = (app: App<Element>) => {
  app.config.globalProperties.$MDHms = formatMDHms;
  app.config.globalProperties.$YMDHms = formatYMDHms;
  app.config.globalProperties.$MDY = formatMDY;
  app.config.globalProperties.$img = getAssetsImage;
  app.config.globalProperties.$copyText = copyText;
  app.config.globalProperties.$formatCurrency = formatCurrency;
  app.config.globalProperties.$formatAssetsNumber = formatAssetsNumber;
  app.config.globalProperties.$formatCurrencyAmount = formatCurrencyAmount;
  app.config.globalProperties.$closeTidio = closeTidio;
  app.config.globalProperties.$openTidio = openTidio;
};
